package com.rabbit.controller;

import com.rabbit.util.ResultGenUtil;
import com.rabbit.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @author zjw
 * @date 2022/02/14 21:30
 */
@Api(tags = "首页模块")
@RestController
@RequestMapping("/index")
public class IndexController {

    @ApiOperation(value = "sayHi", response = ResultVO.class, httpMethod = "GET")
    @GetMapping("/sayHi")
    public ResultVO<Object> sayHi(@RequestParam(value = "name") String name) {
        return ResultGenUtil.genSuccess(name);
    }

    @ApiOperation(value = "sayHi2", response = ResultVO.class, httpMethod = "POST")
    @PostMapping("/sayHi2")
    public ResultVO<Object> sayHi2(@RequestParam(value = "name") String name) {
        return ResultGenUtil.genSuccess(name);
    }
}